<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title th:each="tl,info : ${titlelist}" th:if="${tl.tid} == ${title}" th:text="${tl.tname}">
    </title>
    <link rel="stylesheet" href="/css/commone.css">
    <link rel="stylesheet" href="/css/layui.css" media="all">
    <link rel="stylesheet" href="/css/zx/swiper.css">
    <link rel="stylesheet" href="/css/reset.css">
    <link rel="stylesheet" href="/css/commone.css">
    <link rel="stylesheet" href="/css/commthree.css">
    <link rel="stylesheet" href="/css/commtwo.css">
    <link rel="stylesheet" href="/css/consult.css">
    <script src="/js/jquery-3.5.1.min.js"></script>
</head>
<body>
<div class="content">
    <!-- 顶部搜索 -->
    <div th:include="/user_page/usercenter_head :: usercenterhead"></div>
    <!-- 所有栏目 -->
    <div class="main-tab">
        <div class="max-width">
            <ul class="main-tab-ul">
                <!-- <li class=""><a href="/" target="_self">首页</a></li> -->
                <li class=""><a href="/zx" target="_self">今日推荐</a></li>
                <li th:each="title,info : ${titlelist}" th:if="${info.index < 9}">
                    <a th:href="@{'/zx/sort/' + ${title.tid}}">
                        <span th:text="${title.tname}"></span>
                    </a>
                </li>

                <li class="tab-more-list">
                    <a href="javascript:;" target="_self">
                        <span>更多</span>
                        <img class="arrow-bottom" src="http://www.hasbei.com/static/images/arrow-bttom.png"
                             alt="有贝口腔网">
                    </a>
                    <div>
                        <ul>
                            <li th:each="title,info : ${titlelist}" th:if="${info.index > 8}">
                                <a th:href="@{'/zx/sort/' + ${title.tid}}">
                                    <span th:text="${title.tname}"></span>
                                </a>
                            </li>
                        </ul>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    <!-- 大块 居中 -->
    <div class="content-main">
        <!-- 所在位置导航 -->
        <div class="bread-crumb">
            <div>
                <a href="">首页</a>
                <span>/</span>
                <a th:href="@{'/zx/sort/' + ${title}}">
                <span th:each="tl,info : ${titlelist}" th:if="${tl.tid} == ${title}" th:text="${tl.tname}">
                </span>
                </a>
            </div>
        </div>
        <!-- 分类 -->
        <div class="zixun-info">
            <div class="main-content">
                <div class="main-content-list">
                    <ul class="tab">
                        <li class="ckecked" th:if="${now} eq '1'">
                            <a th:href="@{'/zx/sort/1/' + ${title}}">全部</a></li>
                        <li th:if="${now} ne '1'">
                            <a th:href="@{'/zx/sort/1/' + ${title}}">全部</a></li>
                        <li class="ckecked" th:if="${now} eq '2'">
                            <a th:href="@{'/zx/sort/2/' + ${title}}">热门</a>
                        </li>
                        <li th:if="${now} ne '2'">
                            <a th:href="@{'/zx/sort/2/' + ${title}}">热门</a>
                        </li>
                        <li class="ckecked" th:if="${now} eq '3'">
                            <a th:href="@{'/zx/sort/3/' + ${title}}">最新</a>
                        </li>
                        <li th:if="${now} ne '3'">
                            <a th:href="@{'/zx/sort/3/' + ${title}}">最新</a>
                        </li>
                    </ul>
                </div>
                <div class="main-info-list main-info-t10">
                    <div id="biuuu_city_list" style="background: white"></div>
                    <div id="demo0"></div>
                </div>
            </div>
            <div class="aside-left margin-t0">
                <!-- 相关推荐 -->
                <div class="wonderful-top">
                    <div class="wonderful-top-title">相关推荐</div>
                    <div class="allsee-item">
                        <ul>
                            <li th:each="ot,info : ${other}" th:if="${info.index < 4}">
                                <a th:href="@{'/zx/detail/' + ${ot.id}}" target="_blank">
                                    <span class="other-bg" th:text="${info.index + 1}"></span>
                                    <div th:text="${ot.a_title}"></div>
                                </a>
                            </li>
                            <li th:each="ot,info : ${other}" th:if="${info.index > 3}">
                                <a th:href="@{'/zx/detail/' + ${ot.id}}" target="_blank">
                                    <span th:text="${info.index + 1}"></span>
                                    <div th:text="${ot.a_title}"></div>
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
                <!-- 其他看点 -->
                <div class="wonderful-top">
                    <div class="wonderful-top-title">其他看点</div>
                    <a th:each="otlk,info : ${otlook}"
                       th:href="@{'/zx/detail/=' + ${otlk.id}}" target="_blank">
                        <div class="wonderful-item-line">
                            <div class="allsee-item-left"><img
                                    th:src="${otlk.a_img_url}"></div>
                            <div class="allsee-item-right" th:text="${otlk.a_title}"></div>
                        </div>
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/layui-v2.5.6/layui/layui.js" charset="utf-8"></script>
<script>
    layui.use(['laypage', 'layer'], function () {
        var url = "/sort/load/[[${now}]]/";
        var laypage = layui.laypage;
        var sort = [[${title}]];
        var maxpage = 3;
        $.get("/page/" + sort, function (data, status) {
            window.console.log(status);
            maxpage = data;
        });
        //调用分页
        laypage.render({
            elem: 'demo0'
            , count: maxpage * 10
            , jump: function (obj) {
                //模拟渲染
                $.post(url + obj.curr + "/" + sort, function (data) {
                    document.getElementById('biuuu_city_list').innerHTML = data;
                });
            }
        })
        ;
    })
    ;
</script>
<script>
    var pages = {
        pageSize:11,
        startPage:1,
        type:0,
        state:1,
        alreadyAnsweredOrUnanswered:0
    }
    $.ajax({
        //请求方式
        type : "POST",
        //请求的媒体类型
        contentType: "application/json;charset=UTF-8",
        //请求地址
        url : "http://192.168.0.77:8000/question/inquirePages",
        //数据，json字符串
        data : JSON.stringify(pages),
        //请求成功
        success : function(result) {
            console.log(result);

        },
        //请求失败，包含具体的错误信息
        error : function(e){
            console.log(e.status);
            console.log(e.responseText);
        }
    });
</script>
</body>
</html>